import DailyMangeRouters from './dailyMangeRouters'
import TaskDynamicsRouters from './taskDynamicsRouters'
import EnvironmentMonitorRouters from './environmentMonitorRouters'
import SystemRouters from './systemRouters'

function getRouters() {
  let routers = [{
      path: "index",
      component: resolve => require(["../views/index/index.vue"], resolve),
      name: "index",
      meta: {
        title: "首页"
      }
    },
    {
      path: "traceability",
      component: resolve =>
        require(["../views/traceability/traceability.vue"], resolve),
      name: "traceability",
      meta: {
        title: "溯源查看"
      }
    }
  ];

  return routers
    .concat(EnvironmentMonitorRouters)
    .concat(TaskDynamicsRouters)
    .concat(DailyMangeRouters)
    .concat(SystemRouters)
}

export default [{
    path: "/login",
    component: resolve => require(["../views/login/login.vue"], resolve),
    name: "login"
  },
  {
    path: "/",
    component: resolve => require(["../views/layout/layout.vue"], resolve),
    name: "layout",
    children: getRouters()
  }
];